<!DOCTYPE html>
<html>
<#include "common/head.html" />

<body class="hold-transition skin-blue sidebar-mini fixed">

<#include "common/entity.html" />
<#include "common/modal.html" />
<#include "common/delete.html" />
<!-- <body class="hold-transition skin-blue sidebar-mini sidebar-collapse fixed"> -->
<!-- <body class="hold-transition skin-blue sidebar-mini sidebar-collapse"> -->
<style>
    .dataTables_filter input,.dataTables_filter select{
        width: 150px !important;
        margin-left: 0 !important;
        display: inline-block;
    }
    .dataTables_filter btn-group{
        margin-bottom:2px;
    }
</style>
<a name="main"></a>
<div class="wrapper">

    <header class="main-header">

        <!-- Logo -->
        <a href="javascript:void(0);" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>神象农业管理</b>系统</span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>神象农业管理</b>系统</span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>

            <!-- Navbar Right Menu -->

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a href="#">
                            <img src="${basePath}/common/img/logo.png" class="user-image" alt="User Image">
                            <span class="hidden-xs">${username}</span>
                        </a>
                    </li>
                    <!-- Control Sidebar Toggle Button -->
                    <li>
                        <a href="${basePath}/logout"><i class="fa fa fa-sign-out"></i>退出</a>
                    </li>
                </ul>
            </div>

        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="${basePath}/common/img/logo.png" class="img-circle" alt="User Image" style="height: 45px;">
                </div>
                <div class="pull-left info">
                    <p>${username}</p>
                    <a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
                </div>
            </div>
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" id="mainDiv">

    </div>
    <!--   <div class="content-wrapper" id="mainDiv2">

      </div> -->
    <!-- /.content-wrapper -->

    <footer class="main-footer text-center" style="position:fixed;right:0;bottom:0;left:230px;margin-left:0;">
        <strong>Copyright &copy; 2017 .</strong> All rights
        reserved.
        &nbsp;&nbsp;&nbsp;
    </footer>
    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>

</div>

<#include "common/script.html" />
<!-- 加入页面的的脚本 -->
<script>
    //加载菜单
    SyncGet("${basePath}/manager/user/getFunctionList", null, function (data) {
        var $li, $menu_f_ul;
        $.each(data, function (index, item) {
            if (item.bh.length == 6) {
                $li = $('<li class="treeview"></li>');
                var $menu_f = $('<a href="#">\n' +
                    '<i class="' + item.icon + '"></i> <span>' + item.name + '</span>\n' +
                    ' <span class="pull-right-container">\n' +
                    '<i class="fa fa-angle-left pull-right"></i>\n' +
                    '</span></a>');
                $li.append($menu_f);
                $menu_f_ul = $('<ul class="treeview-menu"></ul>');
                $li.append($menu_f_ul);
                $("ul.sidebar-menu").append($li);
            }
            else if (item.bh.length == 12) {
                $menu_s = $('<li><a href="#" data-url="${basePath}' + item.url + '"><i class="' + item.icon + '"></i>' + item.name + '</a></li>');
                $menu_f_ul.append($menu_s);
            }
        });
    });

    $(function () {
        //首页默认加载

        $("a[data-url]").click(function (evt) {
            $("#mainDiv").empty().load($(this).data("url"));
            $("ul.treeview-menu li").removeClass("active");
            $(this).parent().addClass("active");
        });
    });

</script>
</body>

</html>